package com.wh.hotel.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wh.common.annotation.ResultLog;
import com.wh.common.enums.MethodTypeEnum;
import com.wh.common.vo.Result;
import com.wh.hotel.param.HotelSearchParam;
import com.wh.hotel.service.HotelBaseService;
import com.wh.hotel.vo.HotelListWebVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author wenhao
 */
@RequestMapping("/api/hotel/base")
@RestController
@Slf4j
public class HotelBaseWebController {

    @Resource
    private HotelBaseService hotelBaseService;

    /**
     * 搜索酒店列表
     *
     * @param param
     * @return
     */
    @PostMapping("/hotelSearch")
    @ResultLog(name = "HotelBaseWebController.hotelSearch", methodType = MethodTypeEnum.HTTP_UP)
    public Result<IPage<HotelListWebVo>> hotelSearch(@RequestBody HotelSearchParam param) {
        return Result.successResponse(hotelBaseService.hotelSearch(param));
    }
}
